#静态库制作
# libmyc.a:my_stdio.o my_string.o
# 	ar -rc $@ $^

# my_stdio.o:my_stdio.c
# 	gcc -c $<

# my_string.o:my_string.c
# 	gcc -c $<

# .PHONY:output
# output:
# 	mkdir -p lib/include
# 	mkdir -p lib/mylib

# 	cp *.h lib/include
# 	cp *.a lib/mylib

# 	tar czf lib.tgz lib

# .PHONY:clean
# clean:
# 	rm -rf *.o libmyc.a lib.tgz

#动态库制作
libmyc.so:my_stdio.o my_string.o
	gcc -shared -o $@ $^

my_stdio.o:my_stdio.c
	gcc -fPIC -c $<

my_string.o:my_string.c
	gcc -fPIC -c $<

.PHONY:outllput
output:
	mkdir -p lib/include
	mkdir -p lib/mylib

	cp *.h lib/include
	cp *.so lib/mylib

	tar czf lib.tgz lib

.PHONY:clean
clean:
	rm -rf *.o libmyc.so lib.tgz

